﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<script type="text/javascript">
    var deptCheckSetting = {
        callback: {
            onClick: checkDept
        }
    };

    $(function() {
        var nodes = $("#deptNodes").val();
        $.fn.zTree.init($("#deptCheckzTree"), deptCheckSetting, eval(nodes));
    })

    function checkDept(event, treeId, treeNode) {
        var deptId = treeNode.id;
        var operType = $("#readOnly").val();
        $.ajax({
            type: "POST",
            url: "/Basic/DeptDetail",
            data: { "deptId": deptId, "operType": operType },
            success: function(data) {
                $("#deptDetail").html(data);
            }
        })
    }
</script>
<div style=" padding-top:40px; padding-left:10px;">
    <div class="leftLand">
        <%--<%=Html.DropDownList("pardept", null, new { onchange = "checkDept()" })%>--%>
        <div id="deptCheckzTree" class="ztree">
        </div>
        <input type="hidden" id="deptNodes" value="<%=ViewData["pardept"] %>" />
        <input id="readOnly" type="hidden" value="<%=ViewData["operType"] %>" />
    </div>
    <div class="rightLand">
        <div id="deptDetail">
        </div>
    </div>
</div>
